<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //当promise状态发生改变时，不论如何变化都会执行，不变化不执行
    new Promise((reslove,reject)=>{
      // reslove(123)
      reject('reason')
    }).then(data=>{
      console.log(data);
    }).catch(err=>{
      console.log(err);
    }).finally(data=>{
      console.log(data+'我是finally');
    })
    //finally本质是then()的特列
  </script>
</body>
</html>